import pyperclip
import random
import tkinter
import tkinter.messagebox


def main():
    # 创建顶层窗口
    top = tkinter.Tk()
    # 设置窗口大小
    top.geometry('480x480')
    # 设置窗口标题
    top.title('固定随机文本生成器')
    # 创建一个装按钮的容器
    panel = tkinter.Frame(top)
    # 创建按钮对象 指定添加到那个容器中 通过command参数绑定事件回调函数
    button1 = tkinter.Button(panel, text='修改')
    button1.pack(ipadx=30, ipady=20)
    button1.pack(side='left')
    button2 = tkinter.Button(panel, text='退出')
    button2.pack(ipadx=30, ipady=20)
    button2.pack(side='right')
    button3 = tkinter.Button(panel, text='退出')
    button3.pack(ipadx=30, ipady=20)
    button3.pack(side='right')
    button4 = tkinter.Button(panel, text='退出')
    button4.pack(ipadx=30, ipady=20)
    button4.pack(side='right')
    panel.pack(side='bottom')

    # 定义输入框，将文本框中输入的内容赋值给 var
    entry = tkinter.Entry()
    entry.pack(ipadx=40,ipady=8)
    var = entry.get()

    # 文本框
    # t = tkinter.Text(top, height=2)
    # t.pack()
    
    # 开启主事件循环
    tkinter.mainloop()
    print(var)

if __name__ == '__main__':
    main()